for i in range(10, 1001):
    if i % 2 == 0 and i % 3 == 0 and i % 7 == 0:
        print(i)
